{extends file='dashboard.tpl'}
{block name='body'}
{block name='menus'}{$smarty.block.parent}{/block}
<h2>Tambah Transaksi</h2>

<div id="box-pelanggan" title="Box Pelanggan">

</div>
{literal}
<script type="text/javascript">
(function($){
    $('#box-pelanggan').dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            "Pilih": function(){
                $('#box-pelanggan').dialog('hide');
            }
        }
    });
})(jQuery);
</script>
{/literal}

<form id="form-transaksi" class="form" action="" enctype="multipart/form-data" method="post">
{block name='form_content'} {* begin form_content *}

{block name='master_transaksi'}
    <div class="form-title-left">
        <span class="form-title-text">INFO TRANSAKSI</span>
    </div>
    <div class="form-title-hr"></div>
    <table class="form-table billing-address" cellpadding="0" cellspacing="0">
        <tr>
            <td class="form-order-name"><span>ID</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="id" class="form-order-text text-center" disabled value="{$field->id}"  /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Kode</span></td>
            <td class="dot"><span>:</span></td>
            <td>
                <select name="kode" class="form-order-select text-center" disabled>
                    {foreach $kode_transaksi as $kode}
                    <option value="{$kode}"{if $field->kode == $kode}{/if}>{str_replace('_', ' ', strtoupper($kode@key))}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Kode Urut</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="urutan" class="form-order-text text-center" disabled value="{$field->urutan}" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Tanggal</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="tgl" class="form-order-text text-center" disabled value="{$field->tgl}"  /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Jenis</span></td>
            <td class="dot"><span>:</span></td>
            <td>
                <select name="jenis" class="form-order-select text-center">
                    {foreach $jenis_transaksi as $jenis}
                    <option value="{$jenis}"{if $field->jenis == $jenis}{/if}>{str_replace('_', ' ', strtoupper($jenis@key))}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Status</span></td>
            <td class="dot"><span>:</span></td>
            <td>
                <select name="stat" class="form-order-select text-center">
                    {foreach $status_transaksi as $status}
                    <option value="{$status}"{if $field->stat == $status}{/if}>{str_replace('_', ' ', strtoupper($status@key))}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
    </table>
    <br />
{/block}

{block name='billing_address'}
    <div class="form-title-left">
        <span class="form-title-text">BILLING ADDRESS</span>
    </div>
    <div class="form-title-hr"></div>
    <table class="form-table billing-address" cellpadding="0" cellspacing="0">
        <tr>
            <td class="form-order-name"><span>Nama Lengkap</span></td>
            <td class="dot"><span>:</span></td>
            <td>
                <input type="text" name="billing[nama_lengkap]" class="form-order-text"  />
                <button id="cari-pelanggan">Cari Pelanggan</button>
                {literal}
                <script type="text/javascript">
                (function($){
                    $('#cari-pelanggan').click(function(e){
                        e.preventDefault();
                        e.stopPropagation();
                        $('#box-pelanggan').dialog('open');
                    });
                })(jQuery);
                </script>
                {/literal}

            </td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Alamat</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="billing[alamat]" class="form-order-text"  /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Kode Pos</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="billing[kode_pos]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Provinsi</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="billing[provinsi]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>No Telp / HP</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="billing[telp]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>NPWP (jika ada)</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="billing[npwp]" class="form-order-text" /></td>
        </tr>
    </table>
    <br />
{/block}

{block name='shipping_address'}
    <table class="form-table" cellpadding="0" cellspacing="0">
        <tr>
            <td><input id="check-shipping-address" name="check-shipping-address" type="checkbox" value="1" /></td>
            <td class="form-order-info"><span><i>Silahkan klik di sini jika alamat tagihan sama dengan alamat pengiriman</i></span></td>
        </tr>
    </table>
    <div class="form-title-left">
        <span class="form-title-text">SHIPPING ADDRESS</span>
    </div>
    <div class="form-title-hr"></div>
    <table class="form-table shipping-address" cellpadding="0" cellspacing="0">
        <tr>
            <td class="form-order-name"><span>Nama Lengkap</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[nama_lengkap]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Alamat</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[alamat]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Kode Pos</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[kode_pos]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Provinsi</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[provinsi]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>No Telp / HP</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[telp]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>NPWP (jika ada)</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="shipping[npwp]" class="form-order-text" /></td>
        </tr>
    </table>
    <br />
{/block}

{block name='company'}
    <table class="form-table" cellpadding="0" cellspacing="0">
        <tr>
            <td><input id="check-company" name="check-company" type="checkbox" value="1" /></td>
            <td class="form-order-info"><span><i>Silahkan klik di sini jika order adalah untuk perusahaan / insitusi</i></span></td>
        </tr>
    </table>
    <div class="form-title-left">
        <span class="form-title-text">INFORMASI PERUSAHAAN / INSTITUSI</span>
    </div>
    <div class="form-title-hr"></div>
    <table class="form-table company" cellpadding="0" cellspacing="0">
        <tr>
            <td class="form-order-name"><span>Nama Perusahaan</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="perusahaan[nama_lengkap]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>Alamat Perusahaan</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="perusahaan[alamat]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>No Telp</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="perusahaan[telp]" class="form-order-text" /></td>
        </tr>
        <tr>
            <td class="form-order-name"><span>NPWP Perusahaan</span></td>
            <td class="dot"><span>:</span></td>
            <td><input type="text" name="perusahaan[npwp]" class="form-order-text" /></td>
        </tr>
    </table>
    <br /><br />
{/block}

{block name='informasi_order'}{/block}
    
{block name='total'}{/block}

{/block} {* end form_content *}
</form>

{/block}